import request from '@/utils/request'
import { downFile } from '@/utils/request'

/**
 * 订单返利分页查询
 * @param {查询条件} data
 */
export function listLayOrderChannel(query) {
  return request({
    url: 'business/LayOrderChannel/list',
    method: 'get',
    params: query,
  })
}

/**
 * 新增订单返利
 * @param data
 */
export function addLayOrderChannel(data) {
  return request({
    url: 'business/LayOrderChannel',
    method: 'post',
    data: data,
  })
}
/**
 * 修改订单返利
 * @param data
 */
export function updateLayOrderChannel(data) {
  return request({
    url: 'business/LayOrderChannel',
    method: 'PUT',
    data: data,
  })
}
/**
 * 获取订单返利详情
 * @param {Id}
 */
export function getLayOrderChannel(id) {
  return request({
    url: 'business/LayOrderChannel/' + id,
    method: 'get'
  })
}

/**
 * 删除订单返利
 * @param {主键} pid
 */
export function delLayOrderChannel(pid) {
  return request({
    url: 'business/LayOrderChannel/delete/' + pid,
    method: 'POST'
  })
}
// 导出订单返利
export async function exportLayOrderChannel(query) {
  await downFile('business/LayOrderChannel/export', { ...query })
}
